define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function(){
		this.callParent();
	};

	Model.prototype.saveCommit = function(event){
		alert("保存数据成功！");
	};
	
	Model.prototype.okEditClick = function(event){
		var data = this.comp("mainData");
		data.directDeleteMode = false;
		var rows = [];
		data.each(function(options){
			if (data.getValue("calcCheckBox", options.row)){
				rows.push(options.row);
			}
		});
		if (rows.length > 0){
			data.deleteData(rows);
		}
	};

	Model.prototype.cancelEditClick = function(event){
		var data = this.comp("mainData");
		data.each(function(options){
			if (data.getValue("calcCheckBox", options.row)){
				data.setValue('calcCheckBox',false,options.row);
			}
		});
	};

	Model.prototype.button7Click = function(event){
		

	};

	Model.prototype.content2Load = function(event){

	};

	Model.prototype.modelLoad = function(event){
		
		
		
		//alert();
		
		
	};

	Model.prototype.list2AfterRender = function(event){
		
	
	};

	Model.prototype.list1Click = function(event){
		
		var nt_id=this.comp("typenData").val("nt_id");
		
		
		//var detailUrl = require.toUrl('../list/list.w');
		//this.comp('listDialog').open({
		//	src : detailUrl,
		///	params : {
		//		id : nt_id
		//	}
		//});
		
		justep.Shell.showPage(require.toUrl("../list/list.w"),{"id" : nt_id});
	
	};
	
	Model.prototype.list2Click = function(event){
	
		var nt_id=this.comp("typerdData").val("nt_id");
		
		//justep.Shell.showPage(require.toUrl("../list/list.w"),{"id" : nt_id});
	};



	return Model;
});